package jee.demo.pro.app;

/**
 * UIString.
 *
 * @author f0rb
 * @version 1.0.0 2010-5-29
 */
public interface AppConstant {
    String SLASH = "/";
    String BACKSLASH = "\\";
    String CAPTCHA_IMAGE = "ci";
    String RELOAD_CONFIG = "reload";
    String EXCEPTION_ATTR = "error.exception";

    String REDIRECT_URL = "redirectURL";
    String DEFAULT_LOCALE_NAME = "html_locale";

    interface Cookie {
        String LAST_LOGIN = "last_login"; //last login key
        String ACCOUNT = "account";
        String NICKNAME = "nickname";
        int HOLD_DAY = 14 * 60 * 60 * 24;
    }

    interface Session {
        // 页面上的el表达式可能用到这些常量的值取数据
        String LOGIN_USER = "loginUser";
        String LOGIN_USER_ID = "loginUserId";
        String LOGIN_USERNAME = "loginUsername";
        String REDIRECT_BACK = "REDIRECT_BACK";
        String CAPTCHA = "CAPTCHA";
        String PAYPAL_ENCODER = "PAYPAL_ENCODER";
        String HANDLING_ORDER = "HANDLING_ORDER";
    }

    /**
     * 处理Result到view的.
     * 在Action的注解配置和业务的实现类中使用.
     */
    interface Result {
        String INDEX = "index";
        // 这些值在struts2中配置
        String JSON = "json";
        String HTTP_403 = "403";
        String HTTP_404 = "404";
        String HTTP_500 = "500";
        String REDIRECT_ROOT = "redirect:/"; //重定向到首页
        String REDIRECT_BACK = "redirect:${back}"; //重定向到指定页
        String SA_ERROR = "saError"; //后台通用错误页面
        String FRAME = "@frame"; //前台通用框架页面

        interface User {
            String SA_NEW = "/user/saNew";
            String SA_EDIT = "/user/saEdit";
            String SA_INDEX = "/user/saIndex";
            String SA_INDEX_REDIRECT = "redirect:/user/saIndex";

            String INDEX_REDIRECT = "redirect:/user/";
            String LOGIN_REDIRECT = "redirect:/user/login";
            String TOKEN_SENT = "token-sent";
            String LOGIN = "login";
            String REGISTER = "register";
            String ADMIN = "admin";

            String REGISTER_SUCCESS = "register-success";
            String TOKEN_INVALID = "token-invalid";
            String RESET_PASSWORD = "reset-password";
            String ADMIN_LOGIN = "admin-login";
            String FORGOT_PASSWORD = "forgot-password";
        }
    }
}
